home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / FROMUTS / CDUNGEON / !CDUNGEON / c / LIGHTP < prev    next >
Text File  |  1991-05-20  |  4KB  |  160 lines

  1. /* LIGHTP-    LIGHT PROCESSOR */
  2.  
  3. /*COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142*/
  4. /* ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED */
  5. /* WRITTEN BY R. M. SUPNIK */
  6.  
  7. #include "funcs.h"
  8. #include "vars.h"
  9.  
  10. logical lightp_(obj)
  11. integer obj;
  12. {
  13.     /* System generated locals */
  14.     logical ret_val;
  15.  
  16.     /* Local variables */
  17.     integer flobts;
  18.     integer i;
  19.  
  20.     ret_val = TRUE_;
  21. /*                         !ASSUME WINS */
  22.     flobts = FLAMBT + LITEBT + ONBT;
  23.     if (obj != oindex_1.candl) {
  24.     goto L20000;
  25.     }
  26. /*                         !CANDLE? */
  27.     if (findex_1.orcand != 0) {
  28.     goto L19100;
  29.     }
  30. /*                         !FIRST REF? */
  31.     findex_1.orcand = 1;
  32. /*                         !YES, CANDLES ARE */
  33.     cevent_1.ctick[cindex_1.cevcnd - 1] = 50;
  34. /*                         !BURNING WHEN SEEN. */
  35.  
  36. L19100:
  37.     if (prsvec_1.prsi == oindex_1.candl) {
  38.     goto L10;
  39.     }
  40. /*                         !IGNORE IND REFS. */
  41.     if (prsvec_1.prsa != vindex_1.trnofw) {
  42.     goto L19200;
  43.     }
  44. /*                         !TURN OFF? */
  45.     i = 513;
  46. /*                         !ASSUME OFF. */
  47.     if ((objcts_1.oflag1[oindex_1.candl - 1] & ONBT) != 0) {
  48.     i = 514;
  49.     }
  50. /*                         !IF ON, DIFFERENT. */
  51.     cevent_1.cflag[cindex_1.cevcnd - 1] = FALSE_;
  52. /*                         !DISABLE COUNTDOWN. */
  53.     objcts_1.oflag1[oindex_1.candl - 1] &= ~ ONBT;
  54.     rspeak_(i);
  55.     return ret_val;
  56.  
  57. L19200:
  58.     if (prsvec_1.prsa != vindex_1.burnw && prsvec_1.prsa != vindex_1.trnonw) {
  59.  
  60.     goto L10;
  61.     }
  62.     if ((objcts_1.oflag1[oindex_1.candl - 1] & LITEBT) != 0) {
  63.     goto L19300;
  64.     }
  65.     rspeak_(515);
  66. /*                         !CANDLES TOO SHORT. */
  67.     return ret_val;
  68.  
  69. L19300:
  70.     if (prsvec_1.prsi != 0) {
  71.     goto L19400;
  72.     }
  73. /*                         !ANY FLAME? */
  74.     rspeak_(516);
  75. /*                         !NO, LOSE. */
  76.     prsvec_1.prswon = FALSE_;
  77.     return ret_val;
  78.  
  79. L19400:
  80.     if (prsvec_1.prsi != oindex_1.match || ! ((objcts_1.oflag1[oindex_1.match 
  81.         - 1] & ONBT) != 0)) {
  82.     goto L19500;
  83.     }
  84.     i = 517;
  85. /*                         !ASSUME OFF. */
  86.     if ((objcts_1.oflag1[oindex_1.candl - 1] & ONBT) != 0) {
  87.     i = 518;
  88.     }
  89. /*                         !IF ON, JOKE. */
  90.     objcts_1.oflag1[oindex_1.candl - 1] |= ONBT;
  91.     cevent_1.cflag[cindex_1.cevcnd - 1] = TRUE_;
  92. /*                         !RESUME COUNTDOWN. */
  93.     rspeak_(i);
  94.     return ret_val;
  95.  
  96. L19500:
  97.     if (prsvec_1.prsi != oindex_1.torch || ! ((objcts_1.oflag1[oindex_1.torch 
  98.         - 1] & ONBT) != 0)) {
  99.     goto L19600;
  100.     }
  101.     if ((objcts_1.oflag1[oindex_1.candl - 1] & ONBT) != 0) {
  102.     goto L19700;
  103.     }
  104. /*                         !ALREADY ON? */
  105.     newsta_(oindex_1.candl, 521, 0, 0, 0);
  106. /*                         !NO, VAPORIZE. */
  107.     return ret_val;
  108.  
  109. L19600:
  110.     rspeak_(519);
  111. /*                         !CANT LIGHT WITH THAT. */
  112.     return ret_val;
  113.  
  114. L19700:
  115.     rspeak_(520);
  116. /*                         !ALREADY ON. */
  117.     return ret_val;
  118.  
  119. L20000:
  120.     if (obj != oindex_1.match) {
  121.     bug_(6, obj);
  122.     }
  123.     if (prsvec_1.prsa != vindex_1.trnonw || prsvec_1.prso != oindex_1.match) {
  124.  
  125.     goto L20500;
  126.     }
  127.     if (findex_1.ormtch != 0) {
  128.     goto L20100;
  129.     }
  130. /*                         !ANY MATCHES LEFT? */
  131.     rspeak_(183);
  132. /*                         !NO, LOSE. */
  133.     return ret_val;
  134.  
  135. L20100:
  136.     --findex_1.ormtch;
  137. /*                         !DECREMENT NO MATCHES. */
  138.     objcts_1.oflag1[oindex_1.match - 1] |= flobts;
  139.     cevent_1.ctick[cindex_1.cevmat - 1] = 2;
  140. /*                         !COUNTDOWN. */
  141.     rspeak_(184);
  142.     return ret_val;
  143.  
  144. L20500:
  145.     if (prsvec_1.prsa != vindex_1.trnofw || (objcts_1.oflag1[oindex_1.match - 
  146.         1] & ONBT) == 0) {
  147.     goto L10;
  148.     }
  149.     objcts_1.oflag1[oindex_1.match - 1] &= ~ flobts;
  150.     cevent_1.ctick[cindex_1.cevmat - 1] = 0;
  151.     rspeak_(185);
  152.     return ret_val;
  153.  
  154. /* HERE FOR FALSE RETURN */
  155.  
  156. L10:
  157.     ret_val = FALSE_;
  158.     return ret_val;
  159. } /* lightp_ */
  160.